<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/commons/pages/taglibs.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>客户管理</title>
<link rel="stylesheet" type="text/css" href="../jquery-easyui/themes/${themes}/easyui.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../styles/demo.css">
<script type="text/javascript" src="../jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="../jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../scripts/public.js.jsp"></script>
<script type="text/javascript" src="${ctx}/platform/type-info/format"></script>
</head>
<body>
<!--div class="demo-info">
  <div class="demo-tip icon-tip"></div>
  <div>客户管理</div>
</div-->
<c:if test="${true}">
  <div style="padding:5px; margin-bottom:5px; display:block;" class="combo">
    <form method="post" id="fm_search" novalidate style="display:inline-block">
      客户类别：
        <select id="customer_type" name="customer_type" style="width:80px;">
      </select>
      客户名称：
      <input id="customer_name" name="real_name" style="width:80px;" />
      锁定：
      <select id="is_lock" name="is_lock" style="width:50px;">
      </select>
      删除：
      <select id="is_del" name="is_del" style="width:50px;">
      </select>
      <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="doSearch();">搜索</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="$('#fm_search').form('clear');">重置</a>
    </form>
  </div>
</c:if>
<div id="dg"> </div>
<div id="dlg" class="easyui-dialog" data-options="closed:true, modal:true, buttons:'#dlg-buttons'" style="width:420px; height:520px; padding:10px 40px;">
  <form method="post" id="fm" novalidate>
    <input name="id" type="hidden" id="id" />
    <table>
      <tr>
        <td align="right"><b>客户类别：</b></td>
        <td><select id="customer_type" name="customer_type" class="easyui-validatebox" style="width:140px;" data-options="required:true, editable:false">
          </select></td>
      </tr>
      <tr>
        <td align="right"><b>客户名称：</b></td>
        <td><input type="text" id="customer_name" name="customer_name" class="easyui-validatebox" data-options="required:true" /></td>
      </tr>
      <tr>
        <td align="right"><b>地址：</b></td>
        <td><input type="text" id="customer_addr" name="customer_addr" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>邮编：</b></td>
        <td><input type="text" id="customer_postcode" name="customer_postcode" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>网址：</b></td>
        <td><input type="text" id="customer_website" name="customer_website" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>邮箱：</b></td>
        <td><input type="text" id="customer_email" name="customer_email" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>电话：</b></td>
        <td><input type="text" id="customer_tel" name="customer_tel" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>传真：</b></td>
        <td><input type="text" id="customer_fax" name="customer_fax" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>联系人：</b></td>
        <td><input type="text" id="customer_linkman" name="customer_linkman" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>其他联系方式：</b></td>
        <td><input type="text" id="customer_contact" name="customer_contact" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>备注：</b></td>
        <td><input type="text" id="remark" name="remark" class="easyui-validatebox" /></td>
      </tr>
      <tr>
        <td align="right"><b>排序值：</b></td>
        <td><input id="order_value" name="order_value" style="width:80px;" class="easyui-numberspinner" min="0" max="9999" value="0" /></td>
      </tr>
      <tr>
        <td align="right"><b>是否锁定：</b></td>
        <td><select id="is_lock" name="is_lock" style="width:80px;" class="easyui-validatebox" data-options="required:true, editable:false">
          </select></td>
      </tr>
      <tr>
        <td align="right"><b>是否删除：</b></td>
        <td><select id="is_del" name="is_del" style="width:80px;" class="easyui-validatebox" data-options="required:true, editable:false">
          </select></td>
      </tr>
    </table>
  </form>
</div>
<div id="dlg-buttons"> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="doSave();">保存</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="$('#dlg').dialog('close');">关闭</a> </div>
<script type="text/javascript">
$(function(){
	//初始化列表
	$('#dg').datagrid({
	    url:'${ctx}/platform/customer-info/search',
		queryParams:$('#fm_search').serializeObject(),
	    frozenColumns:[[
	    	{field:'ck',checkbox:true}
	 	]],
	    columns:[[
			{field:'id',title:'id',hidden:true},   
	        {field:'customer_type',title:'客户类别',formatter:formatCustomer},
			{field:'customer_name',title:'客户名称'},
			//{field:'customer_sname',title:'客户短名称'},
			{field:'customer_addr',title:'客户地址'},
			{field:'customer_postcode',title:'客户邮编'},
			{field:'customer_website',title:'网址'},
			{field:'customer_email',title:'邮箱'},
			{field:'customer_tel',title:'电话'},
			{field:'customer_fax',title:'传真'},
			{field:'customer_linkman',title:'联系人'},
			{field:'customer_contact',title:'其他联系方式'},
			//{field:'remark',title:'备注'},
			{field:'create_time',title:'创建时间'},
			{field:'is_lock',title:'锁定',align:'center',formatter:formatBoolean, styler:styleBoolean},
			{field:'is_del',title:'删除',align:'center',formatter:formatBoolean, styler:styleBoolean}
	    ]],
		//fitColumns:true,
		striped:true,
		pagination:true,
		remoteSort:false,
		rownumbers:true,
		singleSelect:false,
		autoSizeColumn:true,
		toolbar:[
			//<c:if test="${true}">
			{
				id:'btnRemove',
				text:'删除',
				iconCls:'icon-remove',
				handler:function(){doRemove();}
			},'-',
			//</c:if>
			//<c:if test="${true}">
			{
				id:'btnAdd',
				text:'添加',
				iconCls:'icon-add',
				handler:function(){doAdd();}
			},
			//</c:if>
			//<c:if test="${true}">
			{
				id:'btnEdit',
				text:'修改',
				iconCls:'icon-edit',
				handler:function(){doEdit();}
			},
			//</c:if>{}
		] 
	});
	
});
</script>
</body>
</html>